package com.itheima.health.controller;


import com.itheima.health.common.R;
import com.itheima.health.entity.TOrdersetting;
import com.itheima.health.pojo.dto.TOrdersettingVO;
import com.itheima.health.service.ITOrdersettingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import java.util.Date;
import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author cpanda
 * @since 2024-01-29
 */
@RestController
@RequestMapping("/ordersetting")
public class TOrdersettingController {
    @Autowired
    ITOrdersettingService ordersettingService;
    @GetMapping("/getOrderSettingByMonth")
    public R getOrderSettingByMonth(String month){
       List<TOrdersettingVO>ordersettings= ordersettingService.getOrderSettingByMonth(month);
        return R.success(ordersettings);
    }
    @PostMapping("/upload")
    public R upload(MultipartFile excelFile){
        ordersettingService.upload(excelFile);
        return R.success(null);
    }
}
